package com.daka.dao;

import com.daka.entity.User;
import com.daka.mybatis.SQLMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author beliveli on 2016/3/31 0031.
 */
@Repository(value = "userMapper")
@SQLMapper
public interface UserMapper {
    User selectByPhone(String phone);

    List<User> selectAll();

    List<User> selectByOrgId(int orgId);

    List<User> selectPageByOrgId(@Param("orgId") Integer orgId, @Param("userName") String userName, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);

    int selectCountByOrgId(@Param("orgId") Integer orgId, @Param("userName") String userName);

    Integer saveUser(User itemSecret);

    User selectById(int manageId);

    int updateById(User user);

    int updatePasswordById(User user);

    int updateOrgIdById(@Param("orgId") Integer orgId, @Param("userId") Integer userId);

    int updateStatus(@Param("status") Integer status, @Param("userId") Integer userId);
}
